package cn.wangzg.courseanimation;

import android.content.Intent;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void btnClick(View view){
        Intent intent=null;
        switch (view.getId()){
            case R.id.btnTween:
                intent=new Intent(this,TweenActivity.class);
                break;
            case R.id.btnFrame:
                intent=new Intent(this,FrameActivity.class);
                break;
            case R.id.btnProperty:
                intent=new Intent(this,PropertyActivity.class);
                break;
        }
        startActivity(intent);
        overridePendingTransition(R.anim.enter_anim,R.anim.exit_anim);
        //overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
        // 采用overridePendingTransition（int enterAnim, int exitAnim）进行设置
        // enterAnim：从Activity a跳转到Activity b，进入b时的动画效果资源ID
        // exitAnim：从Activity a跳转到Activity b，离开a时的动画效果资源Id

        // 特别注意
        // overridePendingTransition（）必须要在startActivity(intent)后被调用才能生效
    }
}
